type token =
  | TokenInt of (int)
  | TokenProp of (string)
  | TokenT
  | TokenF
  | TokenNot
  | TokenAnd
  | TokenOr
  | TokenImp
  | TokenEq
  | TokenNeq
  | TokenNewLine
  | TokenEnd
  | TokenEof

open Parsing;;
# 4 "parser.mly"

open Syntax
# 21 "parser.ml"
let yytransl_const = [|
  259 (* TokenT *);
  260 (* TokenF *);
  261 (* TokenNot *);
  262 (* TokenAnd *);
  263 (* TokenOr *);
  264 (* TokenImp *);
  265 (* TokenEq *);
  266 (* TokenNeq *);
  267 (* TokenNewLine *);
  268 (* TokenEnd *);
  269 (* TokenEof *);
    0|]

let yytransl_block = [|
  257 (* TokenInt *);
  258 (* TokenProp *);
    0|]

let yylhs = "\255\255\
\001\000\002\000\002\000\003\000\004\000\004\000\005\000\005\000\
\006\000\006\000\006\000\006\000\006\000\006\000\006\000\006\000\
\006\000\000\000"

let yylen = "\002\000\
\004\000\000\000\002\000\004\000\001\000\002\000\001\000\003\000\
\001\000\001\000\001\000\002\000\003\000\003\000\003\000\003\000\
\003\000\002\000"

let yydefred = "\000\000\
\000\000\000\000\000\000\018\000\000\000\000\000\000\000\000\000\
\000\000\001\000\003\000\000\000\005\000\000\000\006\000\000\000\
\007\000\004\000\011\000\009\000\010\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\012\000\000\000\000\000\000\000\
\000\000\000\000\008\000\013\000\014\000\015\000\016\000\017\000"

let yydgoto = "\002\000\
\004\000\007\000\008\000\014\000\018\000\028\000"

let yysindex = "\012\000\
\013\255\000\000\014\255\000\000\015\255\027\255\016\255\015\255\
\005\255\000\000\000\000\005\255\000\000\006\255\000\000\017\255\
\000\000\000\000\000\000\000\000\000\000\017\255\017\255\017\255\
\017\255\017\255\017\255\006\255\000\000\017\255\017\255\017\255\
\017\255\017\255\000\000\000\000\000\000\000\000\000\000\000\000"

let yyrindex = "\000\000\
\000\000\000\000\000\000\000\000\018\255\000\000\000\000\018\255\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"

let yygindex = "\000\000\
\000\000\022\000\000\000\020\000\005\000\234\255"

let yytablesize = 33
let yytable = "\029\000\
\030\000\031\000\032\000\033\000\034\000\012\000\016\000\036\000\
\037\000\038\000\039\000\040\000\001\000\003\000\005\000\006\000\
\013\000\017\000\019\000\020\000\021\000\022\000\023\000\024\000\
\025\000\026\000\027\000\009\000\010\000\011\000\002\000\015\000\
\035\000"

let yycheck = "\022\000\
\023\000\024\000\025\000\026\000\027\000\001\001\001\001\030\000\
\031\000\032\000\033\000\034\000\001\000\001\001\001\001\001\001\
\012\001\012\001\002\001\003\001\004\001\005\001\006\001\007\001\
\008\001\009\001\010\001\001\001\013\001\008\000\013\001\012\000\
\028\000"

let yynames_const = "\
  TokenT\000\
  TokenF\000\
  TokenNot\000\
  TokenAnd\000\
  TokenOr\000\
  TokenImp\000\
  TokenEq\000\
  TokenNeq\000\
  TokenNewLine\000\
  TokenEnd\000\
  TokenEof\000\
  "

let yynames_block = "\
  TokenInt\000\
  TokenProp\000\
  "

let yyact = [|
  (fun _ -> failwith "parser")
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 3 : int) in
    let _2 = (Parsing.peek_val __caml_parser_env 2 : int) in
    let _3 = (Parsing.peek_val __caml_parser_env 1 : 'states) in
    Obj.repr(
# 33 "parser.mly"
                                          ( (_1, _2, _3) )
# 121 "parser.ml"
               : Syntax.gba))
; (fun __caml_parser_env ->
    Obj.repr(
# 37 "parser.mly"
              ( [] )
# 127 "parser.ml"
               : 'states))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : 'state) in
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'states) in
    Obj.repr(
# 38 "parser.mly"
                        ( (_1)::_2 )
# 135 "parser.ml"
               : 'states))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 3 : int) in
    let _2 = (Parsing.peek_val __caml_parser_env 2 : int) in
    let _3 = (Parsing.peek_val __caml_parser_env 1 : 'final_sets) in
    let _4 = (Parsing.peek_val __caml_parser_env 0 : 'transitions) in
    Obj.repr(
# 42 "parser.mly"
                                           ( (_1, _2, _3, _4) )
# 145 "parser.ml"
               : 'state))
; (fun __caml_parser_env ->
    Obj.repr(
# 46 "parser.mly"
                    ( [] )
# 151 "parser.ml"
               : 'final_sets))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 1 : int) in
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'final_sets) in
    Obj.repr(
# 47 "parser.mly"
                            ( (_1)::_2 )
# 159 "parser.ml"
               : 'final_sets))
; (fun __caml_parser_env ->
    Obj.repr(
# 51 "parser.mly"
                    ( [] )
# 165 "parser.ml"
               : 'transitions))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 2 : int) in
    let _2 = (Parsing.peek_val __caml_parser_env 1 : 'gate) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'transitions) in
    Obj.repr(
# 52 "parser.mly"
                                        ( (_1, _2)::_3 )
# 174 "parser.ml"
               : 'transitions))
; (fun __caml_parser_env ->
    Obj.repr(
# 56 "parser.mly"
                  ( True )
# 180 "parser.ml"
               : 'gate))
; (fun __caml_parser_env ->
    Obj.repr(
# 57 "parser.mly"
                    ( False )
# 186 "parser.ml"
               : 'gate))
; (fun __caml_parser_env ->
    let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in
    Obj.repr(
# 58 "parser.mly"
                      ( Prop _1 )
# 193 "parser.ml"
               : 'gate))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 0 : 'gate) in
    Obj.repr(
# 59 "parser.mly"
                        ( Not _2 )
# 200 "parser.ml"
               : 'gate))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 1 : 'gate) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'gate) in
    Obj.repr(
# 60 "parser.mly"
                            ( And (_2, _3) )
# 208 "parser.ml"
               : 'gate))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 1 : 'gate) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'gate) in
    Obj.repr(
# 61 "parser.mly"
                           ( Or (_2, _3) )
# 216 "parser.ml"
               : 'gate))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 1 : 'gate) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'gate) in
    Obj.repr(
# 62 "parser.mly"
                            ( Imp (_2, _3) )
# 224 "parser.ml"
               : 'gate))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 1 : 'gate) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'gate) in
    Obj.repr(
# 63 "parser.mly"
                           ( Eq (_2, _3) )
# 232 "parser.ml"
               : 'gate))
; (fun __caml_parser_env ->
    let _2 = (Parsing.peek_val __caml_parser_env 1 : 'gate) in
    let _3 = (Parsing.peek_val __caml_parser_env 0 : 'gate) in
    Obj.repr(
# 64 "parser.mly"
                            ( Neq (_2, _3) )
# 240 "parser.ml"
               : 'gate))
(* Entry main *)
; (fun __caml_parser_env -> raise (Parsing.YYexit (Parsing.peek_val __caml_parser_env 0)))
|]
let yytables =
  { Parsing.actions=yyact;
    Parsing.transl_const=yytransl_const;
    Parsing.transl_block=yytransl_block;
    Parsing.lhs=yylhs;
    Parsing.len=yylen;
    Parsing.defred=yydefred;
    Parsing.dgoto=yydgoto;
    Parsing.sindex=yysindex;
    Parsing.rindex=yyrindex;
    Parsing.gindex=yygindex;
    Parsing.tablesize=yytablesize;
    Parsing.table=yytable;
    Parsing.check=yycheck;
    Parsing.error_function=parse_error;
    Parsing.names_const=yynames_const;
    Parsing.names_block=yynames_block }
let main (lexfun : Lexing.lexbuf -> token) (lexbuf : Lexing.lexbuf) =
   (Parsing.yyparse yytables 1 lexfun lexbuf : Syntax.gba)
